package com.threadpool.mythread.case01;

import java.util.function.Function;
import java.util.function.Predicate;

/**
 * @Author 李李李
 * @2020/4/26 21:13
 *
 * predicate 断定型接口 有一个输入参数 返回值只能是 boolean
 *
 */
public class Case12 {
    public static void main(String[] args) {
        Predicate<String> predicate = new Predicate<String>() {
            @Override
            public boolean test(String s) {
                return s.isEmpty();
            }
        };

        Predicate<String> predicate2 = str -> {
            return str.isEmpty();
        };

        System.out.println(predicate.test("aaa"));
        System.out.println(predicate2.test("aaa"));
    }
}
